package com.codelinecounter.file;

import java.io.File;
import java.util.Collection;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;

public class CodeFileFinder {
	private File rootFileDirectory = null;
	private IOFileFilter javaCodeFilter = FileFilterUtils.suffixFileFilter(".java");

	public CodeFileFinder(File rootDirectory) {
		this.rootFileDirectory = rootDirectory;
	}

	public Collection<File> findAllFiles() {
		return FileUtils.listFiles(this.rootFileDirectory, this.javaCodeFilter, TrueFileFilter.INSTANCE);
	}
}
